package com.example.spring.thread.interrupt;

import java.util.Scanner;

/**
 * @author: orange
 * @create: 2023-08-04 21:52
 * @description:
 */
public class InterruptMain {
    public static void main(String[] args) {
//        InterruptThread interruptThread = new InterruptThread();
        InterruptException exception = new InterruptException();
        Thread thread = new Thread(exception, "InterruptException");
        thread.start();
        Scanner scan = new Scanner(System.in);
        if ("exit".equals(scan.nextLine())) {
            thread.interrupt();
        }
    }
}
